package cn.quevo.core.enums;

/**
 * 返回状态基础编码
 *
 * @author July july_sky@foxmail.com
 * @date 2018-03-09 14:00:14
 * @Copyright ©2015-2035 湘豫(北京)科技有限公司. All Rights Reserved.
 * @version 1.0
 * @return
 */
public enum ResultStatusEnum implements EnumsInterface{
    SUCCESS(200,"请求成功"),
    PARAMS_INCOMPLETE(4000,"请求参数不完整"),
    SIGN_ERROR(4001,"签名错误"),
    RECORD_REPEAT(4002,"记录已存在"),
    RECORD_NOT_EXISTS(4003,"记录不存在或权限不足"),
    RECORD_UNSELECTED(4004,"请选择要操作的记录"),
    PARAMS_ERROR(4005,"请求参数错误"),
    PAGE_PARAMS_ERROR(4006,"分页参数错误"),
    RECORD_LOAD_ERROR(4007,"数据初始化异常"),
    ILLEGAL_PARAMS(4008,"非法请求参数"),
    UNAUTHORIZED(4009,"权限不足"),
    
    NOT_LOGIN(5001,"请求登录后操作"),
    ACCOUNT_NOT_EXISTS(5002,"账号不存在"),
    ACCOUNT_PASSWORD_ERROR(5003,"账号或密码错误"),
    ACCOUNT_LOCK(5004,"账号已锁定"),
    ACCOUNT_DISABLE(5005,"账号已禁用"),
    ACCOUNT_IP_ERROR(5006,"登录IP异常"),
   
    TOKEN_FIALD(5101,"TOKEN认证失败"),
    TOKEN_MIME(5102,"TOKEN认证缺少必要参数"),
    TOKEN_INVALID(5103,"TOKEN已过期"),
    
    METHOD_NOT_EXISTS(5201,"不支持此方法调用"),
    DB_SEARCH_ERROR(5202,"数据检索异常"),
    SERVICE_EXCEPTION(5203,"Service调用异常"),
    DAO_EXCEPTION(5204,"DAO调用异常"),
    SERVICE_ERROR(5205,"服务器异常"),
    TABLE_OR_VIEW_NOT_EXISTS(5206,"表或视图不存在"),
    UNKNOWN_EXCEPTION(999,"未知异常"),
    SAVE_FAILURE(5207,"记录保存失败"),
    EDIT_FAILURE(5208,"记录更新失败");



    private Integer code;
    private String value;
    ResultStatusEnum(Integer code,String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getValue() {
        return this.value;
    }
    
    @Override
    public String toString() {
        return "["+this.getCode()+"]"+this.getValue();
    }
}
